<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>await a file</title>
	</head>
	<body>
		<div id="show">
			
		</div>
		<script>
			async function getFile(){
				let myp=new Promise(function(myResolve,myReject){
					let req = new XMLHttpRequest();
					    req.open('GET', "../3.html");
					    req.onload = function() {
					      if (req.status == 200) {myResolve(req.response);}
					      else {myResolve("File not Found");}
					    };
					    req.send();
				});
				document.getElementById("show").innerHTML=await myp;
			}
			getFile();
		</script>
	</body>
</html>
